/***
 * R-ZBZB-202109280789713：添加下载图标，增加下载列表页面
 */
import request from "@/utils/request";
export const service = () => {
  return !!JSON.parse(localStorage.$loginInfo).tenantId ? "/event" : "/ttevent";
};
//addWarningOrderCollection
export function addWarningOrderCollection(query) {
  return request({
    url: service() + "/alarm/order/collection/addWarningOrderCollection",
    method: "post",
    data: query,
  });
}
//
export function delWarningOrderCollection(query) {
  return request({
    url: service() + "/alarm/order/collection/delWarningOrderCollection",
    method: "post",
    data: query,
  });
}
//
export function getLeaderListByOrderId(params) {
  return request({
    url: service() + "/alarm/order/getLeaderListByOrderId",
    method: "post",
    data: params,
  });
}
//
export function getRecordByType(params) {
  return request({
    url: service() + "/alarm/order/getRecordByType",
    method: "post",
    data: params,
  });
}
//
export function getOrderInfo(params) {
  return request({
    url: service() + "/alarm/order/getOrderInfo",
    method: "post",
    data: params,
  });
}
//
export function getRecordByOrderId(query) {
  return request({
    url: service() + "/alarm/order/getRecordByOrderId",
    method: "post",
    data: query,
  });
}
//
export function getVideoPlaybackUrl(query) {
  return request({
    url: "/video/getVideoPlaybackUrl",
    method: "post",
    data: query,
  });
}
//
export function getProcessDetail(data) {
  return request({
    url: service() + `/alarm/processorder/getProcessDetail`,
    method: "post",
    data,
  });
}
//
export function queryFlowLink(query) {
  return request({
    url: service() + "/flow/alarm/queryFlowLink",
    method: "post",
    data: query,
  });
}

export function warningOrderInfoRel(query) {
  return request({
    url: "/event/alarm/order/warningOrderInfoRel",
    method: "post",
    data: query,
  });
}

/**
 * 租户视角获取摄像机通道
 * @param query
 */
export function getDeviceInfo(query) {
  return request({
    url: "/device/video/device/queryDeviceForWE",
    method: "post",
    data: query,
  });
}

/**
 * 铁塔视角获取摄像机通道
 * @param query
 */
export function getDeviceChannel4Tt(query) {
  return request({
    url: "/ttdevice/video/device/getDeviceChannel4Tt",
    method: "get",
    params: query,
  });
}
